<include file="Public/header"/>
<style>
.checkbox {
display: inline-block;
}

.checkbg {
background: #DBF3DF;
text-align: left;
color: #777;
font-weight: normal;
width: 100%;
padding: 0 0 5px 5px;
}
</style>
<div class="wrapper m-t">
<div class="ibox float-e-margins">
<div class="ibox-title">
<a class="h5 font-bold">新增功能</a>
</div>
<div class="ibox-content">
<form class="form-horizontal" method="post" action="{:U()}">
<div class="form-group">
    <label class="col-sm-2 control-label">岗位</label>

    <div class="col-sm-6">
        <input type="text" name="title" class="form-control">
    </div>
</div>
<div class="line line-dashed line-lg pull-in"></div>
<div class="form-group">
    <label class="col-sm-2 control-label">描述</label>

    <div class="col-sm-6">
        <textarea cols="30" rows="5" name="remark" class="form-control"></textarea>
    </div>

</div>
<div class="line line-dashed line-lg pull-in"></div>
<div class="form-group">
    <label class="col-sm-2 control-label">状态</label>

    <div class="col-sm-6">
        <input type="radio" value="1" name="status" checked>启用 &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="radio" value="0" name="status">禁用
    </div>

</div>
<div class="line line-dashed line-lg pull-in"></div>
<div class="form-group">
    <label class="col-sm-2 control-label">管辖区域</label>

    <div class="col-sm-6">
        <select class="form-control" name="area_id">
            <option value="">请选择</option>
            <volist name="areaList" id="vo">
                <option value="{$vo.id}">{$vo.area_name}</option>
            </volist>
        </select>
    </div>

</div>
<div class="line line-dashed line-lg pull-in"></div>
<div class="form-group">
    <label class="col-sm-2 control-label">岗位授权</label>

    <div class="col-sm-6 ">
        <span class="m-r checkbox"><input class="check-all" type="checkbox"/>全选/反选</span>

        <div class="clearfix"></div>
    </div>
</div>

<volist name="node" id="vo">
    <div class="form-group">
        <label class="col-sm-2 control-label"></label>

        <div class="col-sm-6">
            <div class="checkbg">
                <div class="checkbox">
                    <label>
                        <input class="ids checkids" onclick="checkbtn(this)" name="rules[]" value="{$vo.id}" type="checkbox"/>{$vo.title}
                    </label>
                </div>
            </div>
        </div>
        <notempty name="vo['child']">
            <div class="col-sm-6 col-sm-push-2" style="margin-left: 45px;">
                <volist name="vo['child']" id="vs">
                    <span style="float: left" class="m-r-lg checkbox">
                        <input class="ids" name="rules[]" value="{$vs.id}" type="checkbox"/>{$vs.title}
                    </span>

                    <notempty name="vs['child']">
                        <div class="col-sm-12" style="margin-left: 15px;">
                            <volist name="vs['child']" id="vc">
                                <span style="float: left" class="m-r-lg checkbox">
                                    <input class="ids" name="rules[]" value="{$vc.id}" type="checkbox"/>{$vc.title}
                                </span>
                            </volist>
                            <div class="clearfix"></div>
                        </div>
                    </notempty>
                </volist>
                <div class="clearfix"></div>
            </div>

        </notempty>
    </div>

</volist>

<div class="line line-dashed line-lg pull-in"></div>
<div class="form-group">
    <div class="col-sm-6 col-sm-offset-2">
        <button type="submit" class="btn  btn-info ajax-post col-lg-2 m-r" target-form="form-horizontal"
        >确定
        </button>
        <button type="button" onclick="javascript:history.back(-1);return false;"
                class="btn col-lg-2 btn-primary">返回
        </button>
    </div>
</div>
</form>
</div>
</div>
</div>

<include file="Public/footer"/>
<script>

$(".checkids").click(function(){
    $(this).parents(".form-group").find(".ids").prop("checked", this.checked);
})

</script>